package com.yixing.demo.service;

import com.yixing.demo.mapper.MessageMapper;
import com.yixing.demo.model.HistoryMessage;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class MessageService {
    @Resource
    MessageMapper messageMapper;
    public String getLastMessageBySessionId(int sessionId) {
       return messageMapper.getLastMessageBySessionId(sessionId);
    }

    public List<HistoryMessage> getHistoryMessageBySessionId(int sessionId) {
        return messageMapper.getHistoryMessageBySessionId(sessionId);
    }
}
